<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('投诉率分析')" />
</head>
<body class="gray-bg">

<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="analysis-tsl-form">
                <div class="select-list">
                    <ul>
                        <li class="select-time">
                            <label>选择月份： </label>
                            <input type="text" class="time-input" id="startTime" placeholder="选择月份"  value="2019-07-01" name="startTime"/>

                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-warning" onclick="$.table.exportExcel()" >
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped" style="width:100%" >
            <table id="bootstrap-table" ></table>
        </div>

    </div>
</div>
</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: echarts-js" />
<script th:inline="javascript">
    var datas = [[${@dict.getType('sys_common_status')}]];
    var prefix = ctx + "dataanalysis/tsl";
    $(function() {
        var options = {
            url: prefix+"/list",
            exportUrl: prefix + "/export",
            sortName: "t_tslv",
            sortOrder: "desc",
            modalName: "投诉率分析",
            escape: true,
            showPageGo: true,
            rememberSelected: true,
            columns: [
                {
                    field: 'dw',
                    title: '经营单元'
                },
                {
                    field: 't_tsl',
                    title: '本月投诉量',
                    sortable: true
                },
                {
                    field: 't_yhs',
                    title: '本月用户数'
                },
                {
                    field: 't_tslv',
                    title: '本月投诉率'
                },
                {
                    field: 'l_tsl',
                    title: '上月投诉量',
                    sortable: true
                },
                {
                    field: 'l_yhs',
                    title: '上月用户数',
                    sortable: true
                },
                {
                    field: 'l_tslv',
                    title: '上月投诉率',
                    sortable: true
                },
                {
                    field: 'flag',
                    title: '变化情况',
                    sortable: true,
                    formatter: function(value, row, index) {
                        if (value == 0) {
                            return '<span class="badge badge-primary">正常</span>';
                        } else if (value == 1) {
                            return '<span class="badge badge-danger">上升</span>';
                        }
                    }

                }]
        };

        $.table.init(options);
    });

</script>
</body>
</html>